<template>
    <div>
        <h2>当前计数：{{current}}</h2>
        <counter-operation @add="increment" @sub="decrement"></counter-operation>
    </div>
</template>

<script>
import counterOperation from './counterOperation.vue'
export default {
    components: {
        counterOperation
    },
    data() {
        return {
            current: 0
        }
    },
    methods: {
        increment() {
            this.current += 1 
        },
        decrement() {
            this.current -= 1 
        }
    }
}
</script>

<style>

</style>
